/**
 * Created by Neville Kadwa.
 */
package org.shiftone.cdep;

import junit.framework.TestCase;
import org.apache.log4j.BasicConfigurator;
import org.shiftone.cdep.model.PackageInfo;

public class PackageManagerTestCase extends TestCase
{

    public PackageManagerTestCase()
    {
    }

    public PackageManagerTestCase(String string)
    {
        super(string);
    }

    private PackageManager manager = null;

    protected void setUp() throws Exception
    {
        BasicConfigurator.configure();

        manager = new PackageManager();
        addEntries();

    }

    public void addEntries()
    {

        manager.addEntry("MyClassName");
        manager.addEntry("boo/MyClassName");
        manager.addEntry("baah/MyClassName");
        manager.addEntry("org/shiftone/cdep/CDepMethodVisitor");
        manager.addEntry("org/shiftone/cdep/CDepSignatureVisitor");
        manager.addEntry("org/shiftone/cdep/ClassInfo");
        manager.addEntry("org/shiftone/cdep/MethodInfo$MethodCallInfo");
        manager.addEntry("org/shiftone/cdep/MethodInfo");
        manager.addEntry("org/shiftone/cdep/MethodIgnoreUtil");
        manager.addEntry("org/shiftone/cdep/PackageInfo");
        manager.addEntry("org/shiftone/cdep/PackageManager");
        manager.addEntry("org/shiftone/cdep/Process");
        manager.addEntry("org/shiftone/cdep/store/AbstractStoreManager");
        manager.addEntry("org/shiftone/cdep/store/StoreException");
        manager.addEntry("org/shiftone/cdep/store/StoreManager");
        manager.addEntry("org/shiftone/cdep/store/StoreManagerFactory");
        manager.addEntry("org/shiftone/cdep/util/ClassFilter");
        manager.addEntry("org/shiftone/cdep/util/JarFileNameFilter");
        manager.addEntry("org/shiftone/cdep/util/JavaClassFileNameFilter");
        manager.addEntry("org/shiftone/cdep/util/JDBCUtil");
        manager.addEntry("org/shiftone/cdep/util/NullIterator");
        manager.addEntry("com/google/gwt/user/client/ui/CheckBox");
        manager.addEntry("com/google/gwt/sample/dynatable/client/DayFilterWidget$DayCheckBox");
        manager.addEntry("com/google/gwt/user/client/ui/Composite");
        manager.addEntry("com/google/gwt/sample/dynatable/client/DayFilterWidget");
        manager.addEntry("com/google/gwt/sample/dynatable/client/DynaTableWidget$NavBar");
        manager.addEntry("com/google/gwt/sample/dynatable/client/DynaTableWidget");
        manager.addEntry("com/google/gwt/sample/dynatable/client/Professor");
        manager.addEntry("com/google/gwt/sample/dynatable/client/SchoolCalendarWidget");
        manager.addEntry("com/google/gwt/sample/dynatable/client/Student");
        manager.addEntry("com/google/gwt/user/server/rpc/RemoteServiceServlet");
        manager.addEntry("com/google/gwt/sample/dynatable/server/SchoolCalendarServiceImpl");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/Buttons$1");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/Sink");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/Buttons");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/Frames$1");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/Frames");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/Images$1");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/Images");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/Info$1");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/Info");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/Layouts$1");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/Layouts");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/Lists$1");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/Lists");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/Menus$1");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/Menus");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/Popups$1");
        manager.addEntry("com/google/gwt/user/client/ui/DialogBox");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/Popups$MyDialog");
        manager.addEntry("com/google/gwt/user/client/ui/PopupPanel");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/Popups$MyPopup");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/Popups");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/SinkList");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/Tables$1");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/Tables");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/Tabs$1");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/Tabs");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/Text$1");
        manager.addEntry("com/google/gwt/user/client/ui/KeyboardListenerAdapter");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/Text$3");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/Text");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/Trees$1");
        manager.addEntry("com/google/gwt/user/client/ui/TreeItem");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/Trees$PendingItem");
        manager.addEntry("com/google/gwt/sample/kitchensink/client/Trees");
        manager.addEntry("com/google/gwt/sample/mail/client/AboutDialog");
        manager.addEntry("com/google/gwt/sample/mail/client/Contacts$ContactPopup");
        manager.addEntry("com/google/gwt/sample/mail/client/Contacts");
        manager.addEntry("com/google/gwt/sample/mail/client/Mailboxes");
        manager.addEntry("com/google/gwt/sample/mail/client/MailDetail");
        manager.addEntry("com/google/gwt/sample/mail/client/MailList");
        manager.addEntry("com/google/gwt/sample/mail/client/Shortcuts");
        manager.addEntry("com/google/gwt/sample/mail/client/Tasks");
        manager.addEntry("com/google/gwt/sample/mail/client/TopPanel");
        manager.addEntry("javax/swing/AbstractAction");
        manager.addEntry("com/touchgraph/graphlayout/GLPanel$1");
        manager.addEntry("com/touchgraph/graphlayout/GLPanel$2");
        manager.addEntry("java/awt/event/WindowAdapter");
        manager.addEntry("com/touchgraph/graphlayout/GLPanel$5");
        manager.addEntry("javax/swing/JPanel");
        manager.addEntry("com/touchgraph/graphlayout/GLPanel");
        manager.addEntry("com/touchgraph/graphlayout/graphelements/Locality");
        manager.addEntry("com/touchgraph/graphlayout/graphelements/VisibleLocality$1");
        manager.addEntry("com/touchgraph/graphlayout/graphelements/VisibleLocality$2");
        manager.addEntry("com/touchgraph/graphlayout/graphelements/VisibleLocality");
        manager.addEntry("javax/swing/JApplet");
        manager.addEntry("com/touchgraph/graphlayout/GraphLayoutApplet");
        manager.addEntry("com/touchgraph/graphlayout/interaction/TGAbstractDragUI");
        manager.addEntry("com/touchgraph/graphlayout/interaction/DragAddUI");
        manager.addEntry("com/touchgraph/graphlayout/interaction/DragMultiselectUI");
        manager.addEntry("com/touchgraph/graphlayout/interaction/DragNodeUI");
        manager.addEntry("com/touchgraph/graphlayout/interaction/GLEditUI$1");
        manager.addEntry("java/awt/event/MouseAdapter");
        manager.addEntry("com/touchgraph/graphlayout/interaction/GLEditUI$GLEditMouseListener");
        manager.addEntry("java/awt/event/MouseMotionAdapter");
        manager.addEntry("com/touchgraph/graphlayout/interaction/GLEditUI$GLEditMouseMotionListener");
        manager.addEntry("com/touchgraph/graphlayout/interaction/GLEditUI");
        manager.addEntry("com/touchgraph/graphlayout/interaction/GLNavigateUI$GLNavigateMouseListener");
        manager.addEntry("com/touchgraph/graphlayout/interaction/GLNavigateUI");
        manager.addEntry("com/touchgraph/graphlayout/interaction/HVRotateDragUI");
        manager.addEntry("javax/swing/JScrollBar");
        manager.addEntry("com/touchgraph/graphlayout/interaction/HVScroll$DScrollbar");
        manager.addEntry("com/touchgraph/graphlayout/interaction/HVScroll$HVDragUI");
        manager.addEntry("com/touchgraph/graphlayout/interaction/HVScroll$HVLens");
        manager.addEntry("com/touchgraph/graphlayout/interaction/TGAbstractClickUI");
        manager.addEntry("com/touchgraph/graphlayout/interaction/HVScroll$HVScrollToCenterUI");
        manager.addEntry("com/touchgraph/graphlayout/interaction/HyperScroll$HyperLens");
        manager.addEntry("com/touchgraph/graphlayout/interaction/RotateScroll$DScrollBar");
        manager.addEntry("com/touchgraph/graphlayout/interaction/RotateScroll$RotateDragUI");
        manager.addEntry("com/touchgraph/graphlayout/interaction/RotateScroll$RotateLens");
        manager.addEntry("com/touchgraph/graphlayout/interaction/TGAbstractClickUI$ACUIMouseListener");
        manager.addEntry("com/touchgraph/graphlayout/interaction/TGSelfDeactivatingUI");
        manager.addEntry("com/touchgraph/graphlayout/interaction/TGAbstractDragUI$ADUIMouseListener");
        manager.addEntry("com/touchgraph/graphlayout/interaction/TGAbstractDragUI$ADUIMouseMotionListener");
        manager.addEntry("com/touchgraph/graphlayout/interaction/TGAbstractMouseMotionUI$AMMUIMouseMotionListener");
        manager.addEntry("com/touchgraph/graphlayout/interaction/TGAbstractMouseMotionUI");
        manager.addEntry("com/touchgraph/graphlayout/interaction/TGAbstractMousePausedUI$AMPUIMouseListener");
        manager.addEntry("com/touchgraph/graphlayout/interaction/TGAbstractMousePausedUI");
        manager.addEntry("com/touchgraph/graphlayout/interaction/ZoomScroll$ZoomLens");
        manager.addEntry("com/touchgraph/graphlayout/LocalityUtils$1");
        manager.addEntry("com/touchgraph/graphlayout/LocalityUtils$2");
        manager.addEntry("com/touchgraph/graphlayout/LocalityUtils$3");
        manager.addEntry("com/touchgraph/graphlayout/TGLayout$1");
        manager.addEntry("com/touchgraph/graphlayout/TGLayout$2");
        manager.addEntry("com/touchgraph/graphlayout/TGLayout$3");
        manager.addEntry("com/touchgraph/graphlayout/TGPanel$1");
        manager.addEntry("com/touchgraph/graphlayout/TGPanel$2");
        manager.addEntry("com/touchgraph/graphlayout/TGPanel$3");
        manager.addEntry("com/touchgraph/graphlayout/TGPanel$4");
        manager.addEntry("com/touchgraph/graphlayout/TGPanel$5");
        manager.addEntry("com/touchgraph/graphlayout/TGPanel$6");
        manager.addEntry("com/touchgraph/graphlayout/TGPanel$7");
        manager.addEntry("com/touchgraph/graphlayout/TGPanel$8");
        manager.addEntry("com/touchgraph/graphlayout/TGPanel$AdjustOriginLens");
        manager.addEntry("com/touchgraph/graphlayout/TGPanel$BasicMouseListener");
        manager.addEntry("com/touchgraph/graphlayout/TGPanel$SwitchSelectUI");
        manager.addEntry("com/touchgraph/graphlayout/TGPanel");
        manager.addEntry("org/shiftone/cdep/browser/server/DataServiceImpl");
        manager.addEntry("org/shiftone/cdep/graph/Graph$1");
        manager.addEntry("org/shiftone/cdep/graph/Graph");
        manager.addEntry("junit/framework/TestCase");
        manager.addEntry("org/shiftone/cdep/PackageManagerTestCase");
        manager.addEntry("org/shiftone/cdep/store/HsqlStoreManager");
        manager.addEntry("org/shiftone/cdep/store/OracleStoreManager");
        manager.addEntry("org/shiftone/cdep/store/SqlServerStoreManager");
        manager.addEntry("org/shiftone/cdep/store/StoreManagerTestCase");
        manager.addEntry("org/shiftone/cdep/util/JavaContentFileNameFilter");
        manager.addEntry("com/google/gwt/user/client/ui/ClickListener");
        manager.addEntry("com/google/gwt/user/client/ui/Widget");
        manager.addEntry("java/lang/Object");
        manager.addEntry("com/google/gwt/user/client/ui/VerticalPanel");
        manager.addEntry("com/google/gwt/user/client/ui/HorizontalPanel");
        manager.addEntry("com/google/gwt/user/client/ui/Button");
        manager.addEntry("com/google/gwt/core/client/EntryPoint");
        manager.addEntry("com/google/gwt/user/client/ui/RootPanel");
        manager.addEntry("com/google/gwt/user/client/ui/DockPanel");
        manager.addEntry("com/google/gwt/user/client/ui/HTML");
        manager.addEntry("com/google/gwt/user/client/ui/Grid");
        manager.addEntry("java/lang/StringBuilder");
        manager.addEntry("java/lang/AssertionError");
        manager.addEntry("java/lang/Throwable");
        manager.addEntry("java/lang/Class");
        manager.addEntry("java/lang/IllegalArgumentException");
        manager.addEntry("com/google/gwt/user/client/ui/HTMLTable$CellFormatter");
        manager.addEntry("com/google/gwt/user/client/rpc/IsSerializable");
        manager.addEntry("java/util/List");
        manager.addEntry("java/util/ArrayList");
        manager.addEntry("java/util/Iterator");
        manager.addEntry("com/google/gwt/user/client/rpc/RemoteService");
        manager.addEntry("com/google/gwt/user/client/Command");
        manager.addEntry("com/google/gwt/user/client/rpc/AsyncCallback");
        manager.addEntry("com/google/gwt/core/client/GWT");
        manager.addEntry("com/google/gwt/user/client/rpc/ServiceDefTarget");
        manager.addEntry("com/google/gwt/user/client/DeferredCommand");
        manager.addEntry("java/lang/Comparable");
        manager.addEntry("java/lang/String");
        manager.addEntry("java/util/Random");
        manager.addEntry("java/lang/Math");
        manager.addEntry("java/util/Arrays");
        manager.addEntry("java/io/PrintStream");
        manager.addEntry("com/google/gwt/user/client/ui/RadioButton");
        manager.addEntry("com/google/gwt/user/client/ui/Frame");
        manager.addEntry("com/google/gwt/user/client/ui/LoadListener");
        manager.addEntry("com/google/gwt/user/client/ui/Image");
        manager.addEntry("com/google/gwt/user/client/HistoryListener");
        manager.addEntry("com/google/gwt/user/client/History");
        manager.addEntry("com/google/gwt/user/client/ui/MenuBar");
        manager.addEntry("com/google/gwt/user/client/ui/HTMLPanel");
        manager.addEntry("com/google/gwt/user/client/DOM");
        manager.addEntry("com/google/gwt/user/client/ui/ScrollPanel");
        manager.addEntry("com/google/gwt/user/client/ui/FlowPanel");
        manager.addEntry("com/google/gwt/user/client/ui/ChangeListener");
        manager.addEntry("com/google/gwt/user/client/ui/Label");
        manager.addEntry("com/google/gwt/user/client/ui/ListBox");
        manager.addEntry("com/google/gwt/user/client/ui/MenuItem");
        manager.addEntry("com/google/gwt/user/client/Window");
        manager.addEntry("com/google/gwt/user/client/ui/Hyperlink");
        manager.addEntry("com/google/gwt/user/client/ui/FlexTable");
        manager.addEntry("com/google/gwt/user/client/ui/FlexTable$FlexCellFormatter");
        manager.addEntry("com/google/gwt/user/client/ui/TabPanel");
        manager.addEntry("com/google/gwt/user/client/ui/TextBoxBase");
        manager.addEntry("com/google/gwt/user/client/ui/TextBox");
        manager.addEntry("com/google/gwt/user/client/ui/PasswordTextBox");
        manager.addEntry("com/google/gwt/user/client/ui/TextArea");
        manager.addEntry("com/google/gwt/user/client/ui/TreeListener");
        manager.addEntry("com/google/gwt/user/client/ui/Tree");
        manager.addEntry("com/google/gwt/user/client/WindowResizeListener");
        manager.addEntry("java/util/Vector");
        manager.addEntry("com/google/gwt/user/client/ui/TableListener");
        manager.addEntry("com/google/gwt/user/client/ui/SourcesTableEvents");
        manager.addEntry("com/google/gwt/user/client/ui/HTMLTable$RowFormatter");
        manager.addEntry("com/google/gwt/user/client/ui/StackPanel");
        manager.addEntry("java/awt/Graphics");
        manager.addEntry("java/awt/Color");
        manager.addEntry("java/awt/event/ActionListener");
        manager.addEntry("java/awt/event/ActionEvent");
        manager.addEntry("javax/swing/JComboBox");
        manager.addEntry("java/util/Hashtable");
        manager.addEntry("java/lang/System");
        manager.addEntry("javax/swing/JRadioButton");
        manager.addEntry("javax/swing/ButtonGroup");
        manager.addEntry("javax/swing/JPopupMenu");
        manager.addEntry("javax/swing/JMenuItem");
        manager.addEntry("java/awt/Insets");
        manager.addEntry("java/awt/GridBagConstraints");
        manager.addEntry("java/awt/GridBagLayout");
        manager.addEntry("java/awt/FlowLayout");
        manager.addEntry("java/awt/BorderLayout");
        manager.addEntry("java/awt/Dimension");
        manager.addEntry("java/awt/Container");
        manager.addEntry("javax/swing/JFrame");
        manager.addEntry("java/lang/Integer");
        manager.addEntry("java/util/Collection");
        manager.addEntry("java/util/EventListener");
        manager.addEntry("java/awt/Point");
        manager.addEntry("java/awt/event/MouseEvent");
        manager.addEntry("javax/swing/event/PopupMenuListener");
        manager.addEntry("javax/swing/event/PopupMenuEvent");
        manager.addEntry("javax/swing/KeyStroke");
        manager.addEntry("javax/swing/ActionMap");
        manager.addEntry("javax/swing/ComponentInputMap");
        manager.addEntry("javax/swing/InputMap");
        manager.addEntry("javax/swing/JMenu");
        manager.addEntry("java/lang/Thread");
        manager.addEntry("java/awt/event/AdjustmentListener");
        manager.addEntry("java/awt/event/AdjustmentEvent");
        manager.addEntry("java/awt/event/MouseMotionListener");
        manager.addEntry("java/lang/Exception");
        manager.addEntry("java/util/Enumeration");
        manager.addEntry("java/awt/FontMetrics");
        manager.addEntry("java/awt/Font");
        manager.addEntry("java/lang/Runnable");
        manager.addEntry("java/awt/Image");
        manager.addEntry("org/apache/log4j/Logger");
        manager.addEntry("java/util/Map");
        manager.addEntry("java/lang/Boolean");
        manager.addEntry("org/objectweb/asm/ClassVisitor");
        manager.addEntry("org/objectweb/asm/MethodVisitor");
        manager.addEntry("org/objectweb/asm/AnnotationVisitor");
        manager.addEntry("org/objectweb/asm/FieldVisitor");
        manager.addEntry("org/objectweb/asm/Attribute");
        manager.addEntry("java/lang/Runtime");
        manager.addEntry("org/objectweb/asm/ClassReader");
        manager.addEntry("java/io/File");
        manager.addEntry("java/io/OutputStream");
        manager.addEntry("java/util/zip/ZipFile");
        manager.addEntry("java/io/FileOutputStream");
        manager.addEntry("java/util/zip/ZipEntry");
        manager.addEntry("java/lang/RuntimeException");
        manager.addEntry("java/io/InputStream");
        manager.addEntry("java/io/FileInputStream");
        manager.addEntry("org/objectweb/asm/Label");
        manager.addEntry("org/objectweb/asm/signature/SignatureVisitor");
        manager.addEntry("org/objectweb/asm/signature/SignatureReader");
        manager.addEntry("java/util/HashSet");
        manager.addEntry("java/util/HashMap");
        manager.addEntry("org/apache/bcel/classfile/FieldOrMethod");
        manager.addEntry("org/apache/bcel/classfile/Method");
        manager.addEntry("org/apache/bcel/generic/ConstantPoolGen");
        manager.addEntry("org/apache/bcel/classfile/JavaClass");
        manager.addEntry("org/apache/bcel/Repository");
        manager.addEntry("org/apache/bcel/generic/InvokeInstruction");
        manager.addEntry("org/apache/bcel/generic/InstructionList");
        manager.addEntry("org/apache/bcel/generic/MethodGen");
        manager.addEntry("org/apache/bcel/generic/ArrayType");
        manager.addEntry("org/apache/bcel/generic/ObjectType");
        manager.addEntry("java/sql/Connection");
        manager.addEntry("java/sql/ResultSet");
        manager.addEntry("java/sql/PreparedStatement");
        manager.addEntry("java/sql/SQLException");
        manager.addEntry("java/sql/ResultSetMetaData");
        manager.addEntry("java/lang/Long");
        manager.addEntry("java/sql/Statement");
        manager.addEntry("java/io/PrintWriter");
        manager.addEntry("java/util/Properties");
        manager.addEntry("java/sql/DriverManager");
        manager.addEntry("java/io/FilenameFilter");

    }

    public void testTopLevel()
    {
        PackageInfo[] roots = manager.getRootPackages();

        assertEquals("Number of Roots", 7, roots.length);
    }


}
